package com.wcy.feign.user;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wcy.entity.UserFeedback;
import com.wcy.entity.pageVo.ApiDescriptor;
import com.wcy.entity.pageVo.ColumnConstructor;
import com.wcy.entity.pageVo.PageData;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;

@FeignClient(name = "cloud-provider-user", contextId = "FeignUserFeedbackService")
public interface FeignUserFeedbackService {
    @GetMapping("userFeedback/page")
    public ResponseEntity<Page<UserFeedback>> getPage(@RequestParam(name = "pageNum",defaultValue = "1") int pageNum,
                                                      @RequestParam(name = "pageSize",defaultValue = "10") int pageSize);

    @GetMapping("userFeedback/list")
    public ResponseEntity<List<UserFeedback>> getList();

    @PostMapping("userFeedback/add")
    public ResponseEntity<Void> add(@RequestBody UserFeedback userFeedback);

    @PutMapping("userFeedback/update")
    public ResponseEntity<Void> update(@RequestBody UserFeedback userFeedback);

    @DeleteMapping("userFeedback/delete/{id}")
    public ResponseEntity<Void> delete(@PathVariable("id") Integer id);

    @GetMapping("userFeedback/user/page")
    public ResponseEntity<PageData<UserFeedback>> getUserPage(@RequestParam(name = "pageNum",defaultValue = "1") int pageNum,
                                                              @RequestParam(name = "pageSize",defaultValue = "10") int pageSize);

    @PutMapping("userFeedback/user/update")
    public ResponseEntity<Void> updateByUser(@RequestBody UserFeedback userFeedback);

    @DeleteMapping("userFeedback/user/delete/{id}")
    public ResponseEntity<Void> deleteByUser(@PathVariable("id") Integer id);

    @PostMapping("userFeedback/user/add")
    public ResponseEntity<Boolean> addUserFeedback(@RequestBody UserFeedback userFeedback);
}
